<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html><head><title>ACS_AudioMix - NewAC</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CSection"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="ACS_AudioMix"></a>ACS_AudioMix</h1><div class=CBody><p>Classes that mix audio.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#ACS_AudioMix" >ACS_AudioMix</a></td><td class=SDescription>Classes that mix audio.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Enumerations" >Enumerations</a></td><td class=SDescription></td></tr><tr class="SEnumeration SIndent2 SMarked"><td class=SEntry><a href="#TAudioMixerMode" >TAudioMixerMode</a></td><td class=SDescription>This enumeration represents the different modes of operation for a <a href="#TAudioMixer" class=LClass id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">TAudioMixer</a>.</td></tr><tr class="SClass"><td class=SEntry><a href="#TAudioMixer" >TAudioMixer</a></td><td class=SDescription>This component can mix or concatenate two input audio streams. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#TAudioMixer.Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#TAudioMixer.Input1" >Input1</a></td><td class=SDescription>Use this property to set the first input stream to be mixed or concatenated.</td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#TAudioMixer.Input2" >Input2</a></td><td class=SDescription>Use this property to set the second input stream to be mixed or concatenated.</td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#TAudioMixer.Mode" >Mode</a></td><td class=SDescription>This property sets the mode for the TAudioMixer. </td></tr><tr class="SClass"><td class=SEntry><a href="#TRealTimeMixer" >TRealTimeMixer</a></td><td class=SDescription>This component can mix two input audio streams in real timr. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#TRealTimeMixer.Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#TRealTimeMixer.Input1" >Input1</a></td><td class=SDescription>Use this property to set the first input stream to be mixed. </td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#TRealTimeMixer.Input2" >Input2</a></td><td class=SDescription>Use this property to set the second input stream to be mixed or concatenated. </td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#TRealTimeMixer.OutSampleRate" >OutSampleRate</a></td><td class=SDescription>Use this property to set the output sample rate for the mixer. </td></tr><tr class="SProperty SIndent2"><td class=SEntry><a href="#TRealTimeMixer.OutBitsPerSample" >OutBitsPerSample</a></td><td class=SDescription>Use this property to set the output number of bits per sample for the mixer. </td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#TRealTimeMixer.OutChannels" >OutChannels</a></td><td class=SDescription>Use this property to set the number of channels for the mixer. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Enumerations"></a>Enumerations</h3></div></div>

<div class="CEnumeration"><div class=CTopic><h3 class=CTitle><a name="TAudioMixerMode"></a>TAudioMixerMode</h3><div class=CBody><p>This enumeration represents the different modes of operation for a <a href="#TAudioMixer" class=LClass id=link2 onMouseOver="ShowTip(event, 'tt1', 'link2')" onMouseOut="HideTip('tt1')">TAudioMixer</a>.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry><a name="amMix"></a>amMix</td><td class=CDLDescription>the mixer mixes input streams and the size of the resulting stream is equal to the size of the longest input stream.</td></tr><tr><td class=CDLEntry><a name="amConcatenate"></a>amConcatenate</td><td class=CDLDescription>the two streams are concatenated together and the size of the resulting stream is the sum of the sizes of the input streams.&nbsp; Input1 is written before Input2.</td></tr></table></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="TAudioMixer"></a>TAudioMixer</h2><div class=CBody><p>This component can mix or concatenate two input audio streams.&nbsp; Unlike other stream converter components, TAudioMixer component has two input properties: Input1 and Input2.&nbsp; The input streams should have the same number of channels and sample rates (but may have a different number of bits per sample).&nbsp; Note that input streams may be of different sizes.&nbsp; In amMix mode the streams start at the same time, but the longer stream will play alone after the shorter stream has ended.&nbsp; In amConcatenate mode the second input will play after the first input has ended.&nbsp; Volume1 and Volume2 properties can contronl level of the first and second input respectively in both mixing and concatenation modes.</p><p>This cpmonent decends from <a href="ACS_Classes-pas.html#TAuInput" class=LClass id=link3 onMouseOver="ShowTip(event, 'tt2', 'link3')" onMouseOut="HideTip('tt2')">TAuInput</a>.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#TAudioMixer.Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent1 SMarked"><td class=SEntry><a href="#TAudioMixer.Input1" >Input1</a></td><td class=SDescription>Use this property to set the first input stream to be mixed or concatenated.</td></tr><tr class="SProperty SIndent1"><td class=SEntry><a href="#TAudioMixer.Input2" >Input2</a></td><td class=SDescription>Use this property to set the second input stream to be mixed or concatenated.</td></tr><tr class="SProperty SIndent1 SMarked"><td class=SEntry><a href="#TAudioMixer.Mode" >Mode</a></td><td class=SDescription>This property sets the mode for the TAudioMixer. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="TAudioMixer.Properties"></a>Properties</h3></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="TAudioMixer.Input1"></a>Input1</h3><div class=CBody><p>Use this property to set the first input stream to be mixed or concatenated.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="TAudioMixer.Input2"></a>Input2</h3><div class=CBody><p>Use this property to set the second input stream to be mixed or concatenated.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="TAudioMixer.Mode"></a>Mode</h3><div class=CBody><p>This property sets the mode for the TAudioMixer.&nbsp; The possible values for this property are <a href="#amMix" class=LConstant id=link4 onMouseOver="ShowTip(event, 'tt3', 'link4')" onMouseOut="HideTip('tt3')">amMix</a> and <a href="#amConcatenate" class=LConstant id=link5 onMouseOver="ShowTip(event, 'tt4', 'link5')" onMouseOut="HideTip('tt4')">amConcatenate</a>.</p></div></div></div>

<div class="CClass"><div class=CTopic><h2 class=CTitle><a name="TRealTimeMixer"></a>TRealTimeMixer</h2><div class=CBody><p>This component can mix two input audio streams in real timr.&nbsp; Unlike other stream converter components, TRealTime component has two input properties: Input1 and Input2.&nbsp; The input streams should have the same number of channels and sample rates (but may have a different number of bits per sample).</p><p>The difference between TRealTimeMixer and TAudioMixer is that you can change the inputs while the mixer is running.&nbsp; In fact once the real time mixer is started it will be generating output untill it is stopped explicitly.&nbsp; The mixer will generate silens if it has no input currently.&nbsp; See the docs below on how to assign inputs to the real time mixer.&nbsp; Volume1 and Volume2 properties  can contronl level of the first and second input respectively.</p><p>This cpmonent decends from <a href="ACS_Classes-pas.html#TAuInput" class=LClass id=link6 onMouseOver="ShowTip(event, 'tt2', 'link6')" onMouseOut="HideTip('tt2')">TAuInput</a>.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#TRealTimeMixer.Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent1 SMarked"><td class=SEntry><a href="#TRealTimeMixer.Input1" >Input1</a></td><td class=SDescription>Use this property to set the first input stream to be mixed. </td></tr><tr class="SProperty SIndent1"><td class=SEntry><a href="#TRealTimeMixer.Input2" >Input2</a></td><td class=SDescription>Use this property to set the second input stream to be mixed or concatenated. </td></tr><tr class="SProperty SIndent1 SMarked"><td class=SEntry><a href="#TRealTimeMixer.OutSampleRate" >OutSampleRate</a></td><td class=SDescription>Use this property to set the output sample rate for the mixer. </td></tr><tr class="SProperty SIndent1"><td class=SEntry><a href="#TRealTimeMixer.OutBitsPerSample" >OutBitsPerSample</a></td><td class=SDescription>Use this property to set the output number of bits per sample for the mixer. </td></tr><tr class="SProperty SIndent1 SMarked"><td class=SEntry><a href="#TRealTimeMixer.OutChannels" >OutChannels</a></td><td class=SDescription>Use this property to set the number of channels for the mixer. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="TRealTimeMixer.Properties"></a>Properties</h3></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="TRealTimeMixer.Input1"></a>Input1</h3><div class=CBody><p>Use this property to set the first input stream to be mixed.&nbsp; Assigning input to the real time mixer is tricky.&nbsp; The component assigned to the mixer as an input should be ready to provide data at once.&nbsp; For example if you assign a file input component as a mixing input, the file name should be assigned first to that input component.&nbsp; If you want to change the file to be mixed on the fly without changing the input component t could lok like this:</p><blockquote><pre>WaveIn1.FileName := 'File.wav';
RealTimeMixer1.Input1 := WaveIn1;</pre></blockquote><p>...</p><blockquote><pre>RealTimeMixer1.Input1 := nil;
WaveIn1.FileName := 'NewFile.wav';
RealTimeMixer1.Input1 := WaveIn1;</pre></blockquote><p>Assigning nil to Input1 or Input2 makes the correspondent channel silent until you assign to it something else.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="TRealTimeMixer.Input2"></a>Input2</h3><div class=CBody><p>Use this property to set the second input stream to be mixed or concatenated.&nbsp; See the note at <a href="#TRealTimeMixer.Input1" class=LProperty id=link7 onMouseOver="ShowTip(event, 'tt5', 'link7')" onMouseOut="HideTip('tt5')">Input1</a></p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="TRealTimeMixer.OutSampleRate"></a>OutSampleRate</h3><div class=CBody><p>Use this property to set the output sample rate for the mixer.&nbsp; All the mixer inputs should have this sample rate.&nbsp; IF YOU FORGET TO SET THIS PROPERTY MULTIPLE ERRORS MAY OCCUR.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="TRealTimeMixer.OutBitsPerSample"></a>OutBitsPerSample</h3><div class=CBody><p>Use this property to set the output number of bits per sample for the mixer.&nbsp; The mixer inputs may have different bit depths.&nbsp; IF YOU FORGET TO SET THIS PROPERTY THE ZERO-DIVISION ERROR WILL OCCUR.</p></div></div></div>

<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="TRealTimeMixer.OutChannels"></a>OutChannels</h3><div class=CBody><p>Use this property to set the number of channels for the mixer.&nbsp; All the mixer inputs should have the same number of channels.&nbsp; IF YOU FORGET TO SET THIS PROPERTY THE ZERO-DIVISION ERROR WILL OCCUR.</p></div></div></div>

</div><!--Content-->


<div id=Footer>Content &copy; 2008-2010 Andrei Borovsky. Design &copy; 2008 Wayne Thursby. <b><u><a href="http://symmetrica.net/newac">Go to the project's main page</a></u></b>&nbsp; &middot;&nbsp; <a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->


<div id=Menu><div class=MTitle>NewAC<div class=MSubTitle>v2.6.1</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Documentation</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../doc/txt/introduction-txt.html">Quick Introduction to NewAC</a></div></div><div class=MEntry><div class=MFile><a href="../doc/txt/about_documentation-txt.html">About the Documentation</a></div></div><div class=MEntry><div class=MFile><a href="../doc/txt/cwguide-txt.html">Component Writer&rsquo;s Guide</a></div></div><div class=MEntry><div class=MFile><a href="../doc/txt/license-txt.html">License</a></div></div><div class=MEntry><div class=MFile><a href="../doc/txt/tips_and_tricks-txt.html">Tips &amp; Tricks</a></div></div><div class=MEntry><div class=MFile><a href="../doc/txt/newac-txt.html">About New Audio Components</a></div></div><div class=MEntry><div class=MFile><a href="../doc/txt/features-txt.html">NewAC Main Features List</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Main Units</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile id=MSelected>ACS_AudioMix</div></div><div class=MEntry><div class=MFile><a href="ACS_CDROM-pas.html">ACS_CDROM</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Classes-pas.html">ACS_Classes</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Converters-pas.html">ACS_Converters</a></div></div><div class=MEntry><div class=MFile><a href="ACS_DXAudio-pas.html">ACS_DXAudio</a></div></div><div class=MEntry><div class=MFile><a href="ACS_FLAC-pas.html">ACS_FLAC</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Filters-pas.html">ACS_Filters</a></div></div><div class=MEntry><div class=MFile><a href="ACS_LAME-pas.html">ACS_LAME</a></div></div><div class=MEntry><div class=MFile><a href="ACS_MAC-pas.html">ACS_MAC</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Misc-pas.html">ACS_Misc</a></div></div><div class=MEntry><div class=MFile><a href="ACS_MPC-pas.html">ACS_MPC</a></div></div><div class=MEntry><div class=MFile><a href="ACS_OptimFROG-pas.html">ACS_OptimFROG</a></div></div><div class=MEntry><div class=MFile><a href="ACS_smpeg-pas.html">ACS_SMPEG</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Streams-pas.html">ACS_Streams</a></div></div><div class=MEntry><div class=MFile><a href="ACS_TTA-pas.html">ACS_TTA</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Tags-pas.html">ACS_Tags</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Vorbis-pas.html">ACS_Vorbis</a></div></div><div class=MEntry><div class=MFile><a href="ACS_WavPack-pas.html">ACS_WavPack</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Wave-pas.html">ACS_Wave</a></div></div><div class=MEntry><div class=MFile><a href="ACS_WinMedia-pas.html">ACS_WinMedia</a></div></div><div class=MEntry><div class=MFile><a href="ACS_AAC-pas.html">ACS_AAC</a></div></div><div class=MEntry><div class=MFile><a href="AudioDMO-pas.html">AudioDMO</a></div></div><div class=MEntry><div class=MFile><a href="AudioPass-pas.html">AudioPass</a></div></div><div class=MEntry><div class=MFile><a href="AuSampleRate-pas.html">AuSampleRate</a></div></div><div class=MEntry><div class=MFile><a href="AuASIO-pas.html">AuASIO</a></div></div><div class=MEntry><div class=MFile><a href="AuSynch-pas.html">AuSynch</a></div></div><div class=MEntry><div class=MFile><a href="NewACDTS-pas.html">NewACDTS</a></div></div><div class=MEntry><div class=MFile><a href="NewAC_AVI-pas.html">NewAC_AVI</a></div></div><div class=MEntry><div class=MFile><a href="NewAC_DSP-pas.html">NewAC_DSP</a></div></div><div class=MEntry><div class=MFile><a href="NewACAC3-pas.html">NewACAC3</a></div></div><div class=MEntry><div class=MFile><a href="NewACIndicators-pas.html">NewACIndicators</a></div></div><div class=MEntry><div class=MFile><a href="NewACDSAudio-pas.html">NewACDSAudio</a></div></div><div class=MEntry><div class=MFile><a href="ACS_AAC-pas.html">ACS_AAC</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Utility Units</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="ACS_Misc-pas.html">ACS_Misc</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Procs-pas.html">ACS_Procs</a></div></div><div class=MEntry><div class=MFile><a href="acs_reg-pas.html">ACS_Reg</a></div></div><div class=MEntry><div class=MFile><a href="ACS_Types-pas.html">ACS_Types</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">Tutorials</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="../demos/Tutorial/AudioProcessor/Main-pas.html">Audio Processor</a></div></div><div class=MEntry><div class=MFile><a href="../demos/Tutorial/ComponentsDemo/ComponentsDemo-pas.html">Components Demo</a></div></div><div class=MEntry><div class=MFile><a href="../demos/Recorders-rippers/Rip'n'listen/Main-pas.html">Rip&rsquo;n&rsquo;Listen Demo</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../dunit/dunit/Test_ACS_MAC-pas.html">ACS_MAC TestCases</a></div></div><div class=MEntry><div class=MFile><a href="../dunit/dunit/Test_ACS_WavPack-pas.html">ACS_WavPack TestCases</a></div></div><div class=MEntry><div class=MFile><a href="../dunit/dunit/Test_ACS_FLAC-pas.html">TestFLACEncode</a></div></div><div class=MEntry><div class=MFile><a href="../dunit/dunit/uLog-pas.html">uLog.pas</a></div></div><div class=MEntry><div class=MFile><a href="../dunit/dunit/uTestBase-pas.html">uTestBase</a></div></div><div class=MEntry><div class=MFile><a href="../dunit/dunit/uUtility-pas.html">uUtility</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Index</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Constants.html">Constants</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Properties.html">Properties</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Types.html">Types</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Variables.html">Variables</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Files.html">Files</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option  id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Constants">Constants</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Properties">Properties</option><option value="Types">Types</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([2], 6);// --></script></div><!--Menu-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass>This component can mix or concatenate two input audio streams. </div></div><div class=CToolTip id="tt2"><div class=CClass>The ancestor class for all input components.</div></div><div class=CToolTip id="tt3"><div class=CConstant>the mixer mixes input streams and the size of the resulting stream is equal to the size of the longest input stream.</div></div><div class=CToolTip id="tt4"><div class=CConstant>the two streams are concatenated together and the size of the resulting stream is the sum of the sizes of the input streams. </div></div><div class=CToolTip id="tt5"><div class=CProperty>Use this property to set the first input stream to be mixed. </div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>